(function(){
        var myChart=echarts.init(document.getElementById('left3'));
        var option = {
    title: {
            text: '营收科目占比',
            textStyle: {color:"#21e6c1",fontSize: 18,fontFamily:"楷体"},
            left:'12%',
            top:'5%'
    },
    grid: {left:'5%',
           right:'5%',
           top:'20%',
           bottom:'5%',
           containLabel:true
       },
    tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
    },
    series: [
        {
            name: '科目类别',
            type: 'pie',
            radius: '55%',
            center: ['50%', '60%'],
            data: [],
            itemStyle: { normal:{
                                                 label:{show:true,
                                                        formatter: '{b}({d}%)',
                                                        textStyle:{color:"white",fontSize:10}
                                                       },
                                                 labelLine:{show:true,
                                                            lineStyle:{color:'#88bef5'}
                                                            }
                                                      },
                                             },
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};

function get_json_bar() {
    $.ajax({
        url: 'http://localhost:5000/left3',
        type: 'GET',
        success: function (e) {
        option.series[0].data = e;
        myChart.setOption(option);
        setTimeout(get_json_bar,10000)
                               }
            });
}
//执行函数
get_json_bar();

          myChart.setOption(option);
})();